<template>
    <div class="layout-detail">
        <div 
        v-if="bread.length"
        class="bread"
        >
            <el-breadcrumb 
            class="breadcrumb"
            separator="/"
            >
                <el-breadcrumb-item 
                :to="{ path: '/home' }"
                >
                    首页
                </el-breadcrumb-item>
                
                <el-breadcrumb-item 
                v-for="(item, index) in bread"
                :key="index"
                :to="item.route"
                >
                    {{item.title}}
                </el-breadcrumb-item>
            </el-breadcrumb>
        </div>

        <div class="left">
            <slot name="left"></slot>
        </div>
        <div class="right">
            <slot name="right"></slot>
        </div>
    </div>
</template>

<script>
export default {
    props: {
        bread: {
            type: Array,
            default: () => [],
        }
    }  
};
</script>

<style lang="scss" scoped>
    .layout-detail{
        overflow: hidden;

        .bread{
            margin-bottom: 20px;

            .breadcrumb{
                color: #333;
            }
        }

        .left {
            float: left;
            width: 840px;
        }

        .right {
            float: right;
            width: 350px;
        }
    }
</style>